import Vue from 'vue'
import Router from 'vue-router'
import Login from '@/views/Login'
import Home from '@/views/Home'
import Welcome from '@/views/Welcome/Welcome.vue'
import Users from '@/views/user/users'
import Roles from '@/views/auth/Roles'
import Rights from '@/views/auth/Rights'
import Goods from '@/views/product/Goods'
import AddGoods from '@/views/product/AddGoods'
import EditGoods from '@/views/product/EditGoods'
import Param from '@/views/product/Param'
import Category from '@/views/product/Category'
import Order from '@/views/order/Order'
import Reports from '@/views/reports/Reports'
Vue.use(Router)

export default new Router({
  routes: [{
    name: "Login",
    path: "/login",
    component: Login
  }, {
    name: "Home",
    path: "/",
    component: Home,
    redirect: {
      name: 'Welcome'
    },
    children: [{
        name: 'Welcome',
        path: 'welcome',
        component: Welcome
      },
      {
        name: 'Users',
        path: 'users',
        component: Users
      },
      {
        name: 'Roles',
        path: 'roles',
        component: Roles
      },
      {
        name: 'Rights',
        path: 'rights',
        component: Rights
      }, {
        name: 'Category',
        path: 'categories',
        component: Category
      }, {
        name: 'Param',
        path: 'params',
        component: Param
      }, {
        name: 'Goods',
        path: 'goods',
        component: Goods
      }, {
        name: 'Order',
        path: 'orders',
        component: Order
      }, {
        name: 'AddGoods',
        path: 'addGoods',
        component: AddGoods
      }, {
        name: 'EditGoods',
        path: 'editGoods',
        component: EditGoods
      }, {
        name: 'Reports',
        path: 'reports',
        component:Reports
      }
    ]
  }]
})
